package org.rcy.framework.file.excel;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.event.AnalysisEventListener;

import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;

/**
 * @author 吴康桥
 * @Description
 * @date 2022/12/12 16:29
 */


public class EasyExcelService {
	public static void writeExcel(OutputStream ops, List<Object> dataList,Class clazz,String sheetName){
		EasyExcel.write(ops,clazz)
				.sheet(sheetName)
				.doWrite(dataList);
	}

	public static void readExcel(InputStream is, Class clazz, AnalysisEventListener listener){
		EasyExcel.read(is,clazz,listener)
				.sheet()
				.doRead();
	}
}
